home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWDebug / Include / FWTrace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-21  |  2.1 KB  |  81 lines  |  [TEXT/MPS ]

  1. #if !defined(FWTRACE_H) && defined(FW_DEBUG)
  2. #define FWTRACE_H
  3. // This entire file is for debugging only
  4. //========================================================================================
  5. //
  6. //    File:                FWTrace.h
  7. //    Release Version:    $ 1.0d1 $
  8. //
  9. //    Creation Date:        3/28/94
  10. //
  11. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  12. //
  13. //========================================================================================
  14.  
  15. #ifndef FWDBGSTR_H
  16. #include "FWDbgStr.h"
  17. #endif
  18.  
  19. #ifndef   FWTRACET_H
  20. #include "FWTraceT.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. // CLASS FW_CTraceRuntime
  25. //========================================================================================
  26.  
  27. class FW_CTraceRuntime
  28. {
  29. public:
  30.  
  31.     static short Initialize(FW_CDebugStream *traceStream);
  32.         // Prepare to trace.  Acquires resources needed for tracing.
  33.         // Client must ensure that traceStream is opened for writing.
  34.         // Returns zero if could not initialize, non-zero if successful.
  35.         
  36.     static void Terminate();
  37.         // Release resources needed for tracing.
  38.         // Client can now close the trace stream.
  39.  
  40.     static void StartTrace();
  41.         // Starts (resumes) tracing to the trace stream.
  42.         // It is an error to start tracing without successful call to Initialize.
  43.      
  44.     static void StopTrace();
  45.         // Stops (suspends) tracing to the trace stream.
  46.  
  47.     static void IncrTraceDepth();
  48.     static void DecrTraceDepth();
  49.     
  50. #ifdef FW_BUILD_WIN
  51.     static void* GetTraceBuffer();
  52.     static void SetTraceBuffer(void* pTraceBuffer);
  53.     static void TraceIn();
  54.     static void TraceOut();
  55.     
  56.     static void DumpOneLine(FW_CDebugStream& traceStream,
  57.                             const char* pzPrefix,
  58.                             unsigned hModule,            // HANDLE
  59.                             unsigned wSegment,            // WORD
  60.                             unsigned wOffset);            // WORD
  61. #endif
  62.  
  63.     enum StepInOut { kStepIn=0, kStepOut=1};
  64.     static char gPrefixChar[2];
  65.  
  66. #ifdef FW_BUILD_MAC
  67.     static void TraceIn();
  68.     static void TraceOut();
  69.     static void DumpOneLine(FW_CDebugStream& traceStream,
  70.                               unsigned short depth,
  71.                               StepInOut direction,
  72.                               const char* procName);
  73. #endif
  74.  
  75. private:
  76.     FW_CTraceRuntime();
  77.         // Don't construct this object.
  78. };
  79.  
  80. #endif
  81.